Go-opera-test - EVM-compatible chain secured by the Lachesis consensus algorithm

Opera

EVM-compatible chain secured by the Lachesis consensus algorithm.

Building the source

Building opera requires both a Go (version 1.14 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run

make opera

The build output is build/opera executable.

Running opera

Going through all the possible command line flags is out of scope here, but we've enumerated a few common parameter combos to get you up to speed quickly on how you can run your own opera instance.

Launching a network

Before first launching of your mainnet node you will need appropriate genesis file:

wget https://opera.fantom.network/mainnet.g

Or for testnet node:

wget https://opera.fantom.network/testnet.g

Launching opera readonly (non-validator) node for network specified by the genesis file:

$ opera --genesis mainnet.g

Configuration

As an alternative to passing the numerous flags to the opera binary, you can also pass a configuration file via:

$ opera --config /path/to/your_config.toml

To get an idea how the file should look like you can use the dumpconfig subcommand to export your existing configuration:

$ opera --your-favourite-flags dumpconfig

Validator

New validator private key may be created with opera validator new command.

To launch a validator, you have to use --validator.id and --validator.pubkey flags to enable events emitter.

$ opera --nousb --validator.id YOUR_ID --validator.pubkey 0xYOUR_PUBKEY

opera will prompt you for a password to decrypt your validator private key. Optionally, you can specify password with a file using --validator.password flag.

Participation in discovery

Optionally you can specify your public IP to straighten connectivity of the network. Ensure your TCP/UDP p2p port (5050 by default) isn't blocked by your firewall.

$ opera --nat extip:1.2.3.4

Dev

Running testnet

The network is specified only by its genesis file, so running a testnet node is equivalent to using a testnet genesis file instead of a mainnet genesis file:

$ opera --genesis /path/to/testnet.g # launch node

It may be convenient to use a separate datadir for your testnet node to avoid collisions with other networks:

$ opera --genesis /path/to/testnet.g --datadir /path/to/datadir # launch node
$ opera --datadir /path/to/datadir account new # create new account
$ opera --datadir /path/to/datadir attach # attach to IPC

Testing

Lachesis has extensive unit-testing. Use the Go tool to run tests:

go test ./...

If everything goes well, it should output something along these lines:

ok  	github.com/Fantom-foundation/go-opera/app	0.033s
?   	github.com/Fantom-foundation/go-opera/cmd/cmdtest	[no test files]
ok  	github.com/Fantom-foundation/go-opera/cmd/opera	13.890s
?   	github.com/Fantom-foundation/go-opera/cmd/opera/metrics	[no test files]
?   	github.com/Fantom-foundation/go-opera/cmd/opera/tracing	[no test files]
?   	github.com/Fantom-foundation/go-opera/crypto	[no test files]
?   	github.com/Fantom-foundation/go-opera/debug	[no test files]
?   	github.com/Fantom-foundation/go-opera/ethapi	[no test files]
?   	github.com/Fantom-foundation/go-opera/eventcheck	[no test files]
?   	github.com/Fantom-foundation/go-opera/eventcheck/basiccheck	[no test files]
?   	github.com/Fantom-foundation/go-opera/eventcheck/gaspowercheck	[no test files]
?   	github.com/Fantom-foundation/go-opera/eventcheck/heavycheck	[no test files]
?   	github.com/Fantom-foundation/go-opera/eventcheck/parentscheck	[no test files]
ok  	github.com/Fantom-foundation/go-opera/evmcore	6.322s
?   	github.com/Fantom-foundation/go-opera/gossip	[no test files]
?   	github.com/Fantom-foundation/go-opera/gossip/emitter	[no test files]
ok  	github.com/Fantom-foundation/go-opera/gossip/filters	1.250s
?   	github.com/Fantom-foundation/go-opera/gossip/gasprice	[no test files]
?   	github.com/Fantom-foundation/go-opera/gossip/occuredtxs	[no test files]
?   	github.com/Fantom-foundation/go-opera/gossip/piecefunc	[no test files]
ok  	github.com/Fantom-foundation/go-opera/integration	21.640s

Also it is tested with fuzzing.

Operating a private network (fakenet)

Fakenet is a private network optimized for your private testing. It'll generate a genesis containing N validators with equal stakes. To launch a validator in this network, all you need to do is specify a validator ID you're willing to launch.

Pay attention that validator's private keys are deterministically generated in this network, so you must use it only for private testing.

Maintaining your own private network is more involved as a lot of configurations taken for granted in the official networks need to be manually set up.

To run the fakenet with just one validator (which will work practically as a PoA blockchain), use:

$ opera --fakenet 1/1

To run the fakenet with 5 validators, run the command for each validator:

$ opera --fakenet 1/5 # first node, use 2/5 for second node

If you have to launch a non-validator node in fakenet, use 0 as ID:

$ opera --fakenet 0/5

After that, you have to connect your nodes. Either connect them statically or specify a bootnode:

$ opera --fakenet 1/5 --bootnodes "enode://[email protected]:5050"

Running the demo

For the testing purposes, the full demo may be launched using:

cd demo/
./start.sh # start the Opera processes
./stop.sh # stop the demo
./clean.sh # erase the chain data

Check README.md in the demo directory for more information.

Owner
Tenderly
Start monitoring your contracts with error tracking, detailed contract analytics and smart alerts that notify you when something happens.
Tenderly
Similar Resources

Snowflake algorithm generation worker Id sequence

sequence snowflake algorithm generation worker Id sequence 使用雪花算法生成ID,生成100万个只需要

Jan 21, 2022

Implementation of the Feynman algorithm to solve any problem!

Feynman Algorithm Allegedly coined in jest by Murray Gell-Mann to describe Richard Feynman's incredible problem solving ability, this simple algorithm

Mar 16, 2022

James is your butler and helps you to create, build, debug, test and run your Go projects

James is your butler and helps you to create, build, debug, test and run your Go projects

go-james James is your butler and helps you to create, build, debug, test and run your Go projects. When you often create new apps using Go, it quickl

Oct 8, 2022

Enrich `go test` outputs with text decorations.

Enrich `go test` outputs with text decorations.

richgo Rich-Go will enrich go test outputs with text decorations Installation (go get): go get -u github.com/kyoh86/richgo (homebrew): brew tap kyoh8

Dec 28, 2022

Automatically generate Go test boilerplate from your source code.

Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Jan 3, 2023

Solution to elevator test problem but this time recursive and in go

Synopsis A multi-floor building has a Lift in it. People are queued on different floors waiting for the Lift. Some people want to go up. Some people w

Nov 8, 2021

Implementation of the test task, chat in the goland language

Implementation of the test task, chat in the goland language

Implementation of the test task, chat in the goland language

Dec 5, 2021

A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths.

A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths.

A Golang program for a colleague to help in calculating the ratio between the points obtained in a test and the corresponding evaluation in tenths. If you have not the compiled file (.exe) you can build it with the Go compiler.

Jul 7, 2022

MNC Technical Test With Golang

MNC Technical Test With Golang

Nov 20, 2021
Go-enum-algorithm - Implement an enumeration algorithm in GO

go-enum-algorithm implement an enumeration algorithm in GO run the code go run m

Feb 15, 2022
A test repo to demonstrate the current (go1.17.2) issue when trying to use retractA test repo to demonstrate the current (go1.17.2) issue when trying to use retract

test-go-mod-retract This is a test repo to demonstrate the current (go1.17.2) issue when trying to use retract in go.mod to retract a version in a non

Oct 16, 2021
CRAQ (Chain Replication with Apportioned Queries) in Go

CRAQ is a replication protocol that allows reads from any replica while still maintaining strong consistency. CRAQ should provide better read throughput than Raft and Paxos. Read performance grows linearly with the number of nodes added to the system. Network chatter is significantly lower compared to Raft and Paxos.

Dec 5, 2022
did:ar | multi-chain DIDs backed by Arweave
did:ar | multi-chain DIDs backed by Arweave

did:ar | multi-chain DIDs backed by Arweave - THIS IS A WIP ABSOLUTELY SHOULD NOT BE USED IN PRODUCTION ___ ___

Sep 20, 2022
Supply chain management indie game... IN SPACE!
Supply chain management indie game... IN SPACE!

Ship shape Supply chain management indie game ... IN SPACE! Current state is preliminary - there's a six-level tutorial, about an hour's worth of game

Nov 3, 2022
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)
Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)

eaopt is an evolutionary optimization library Table of Contents Changelog Example Background Features Usage General advice Genetic algorithms Overview

Dec 30, 2022
Genetic Algorithm written in go

This genetic algorithm is designed to minimise the problem specific code from a genetic algorithm. The three interfaces Gene, Initialiser, an Evaluato

Feb 15, 2022
Geth client which picks the most profitable blocks to mine using a greedy algorithm

Greeden-Geth Greeden-Geth is a protocol-agnostic client which uses a greedy algorithm to pick the most profitable blocks to submit to the network out

Nov 16, 2022
Go implementation of Donald Knuth's Algorithm 7.2.2.1C for exact cover with colors.

go-dlx Go implementation of Donald Knuth's Algorithm 7.2.2.1C for exact cover with colors. This code is based on the Algorithm C described in http://w

Dec 14, 2022
Simple distributed kv-store using ABD algorithm.

Distributed-kv-store Simple distributed kv-store using ABD algorithm. API GET /key Get value by key. 302 = found key. PUT /key Put key with value. 201

Dec 14, 2021