• Stars
    star
    255
  • Rank 154,867 (Top 4 %)
  • Language
    Go
  • License
    GNU Lesser Genera...
  • Created almost 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Opera blockchain protocol 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

You will need a genesis file to join a network, which may be found in https://github.com/Fantom-foundation/lachesis_launch

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

$ opera --genesis file.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.

More Repositories

1

go-lachesis

aBFT consensus for permission-less networks
Go
214
star
2

Artion-Contracts

Smart contracts for Fantom Artion Marketplace
Solidity
125
star
3

Artion-Client

Client app for Artion, a global NFT marketplace on Fantom Opera.
JavaScript
83
star
4

Fantom-PWA-Wallet

JavaScript and Vue based Fantom PWA wallet
Vue
81
star
5

tokensale

Token sale smart contract and audits
JavaScript
65
star
6

fantom-api-graphql

Fast and secure GraphQL API for aggregated Opera block chain information.
Go
51
star
7

bnbridge.exchange

https://bnbridge.exchange
JavaScript
47
star
8

lachesis-rs

Lachesis BFT consensus for permission-less networks, in Rust
Rust
36
star
9

Fantom_ClientJS_Utils

JS library for simplified work with specific tools and interfaces of the Fantom Opera blockchain client ecosystem: DeFi smart contract calls, Staking and rewards SFC commands, Fantom Ledger App calls
JavaScript
35
star
10

lachesis_launch

Configs for various testnet and mainnet configurations
35
star
11

Fantom-DeFi

Fantom DeFi smart contract implementation of the FLend, FTrade and FMint functions.
Solidity
29
star
12

Artion-Server

Artion API Server
JavaScript
24
star
13

Fantom-PWA-Explorer

JavaScript and Vue based Fantom PWA explorer
Vue
20
star
14

lachesis-base

Lachesis aBFT consensus algorithm library
Go
19
star
15

Artion-Client-V2

Extended Artion client interface.
Vue
18
star
16

Fantom-FMint

FMint part of the DeFi ecosystem.
JavaScript
18
star
17

fantom-sfc

The SFC (Special Fee Contract) maintains a list of validation stakers and delegators and distributes the rewards.
JavaScript
17
star
18

fantom-web3-wallet

NPM package for web3js functionality for Fantom wallet applications
JavaScript
15
star
19

Artion-API-GraphQL

GraphQL API for Fantom Artion
Go
15
star
20

fantom-mobile-app

Mobile wallet and payments application for Fantom Opera chain. Deprecated in favour of Fantom-PWA-Wallet.
JavaScript
15
star
21

opera-sfc

Solidity
12
star
22

desktop-web-wallet

Desktop and web-based wallets for the Fantom network
TypeScript
12
star
23

FtmStableCoin

Solidity
11
star
24

Fantom-CrossChain-Bridge

Repository implements cross-chain bridge with distributed transactions validation.
Solidity
10
star
25

go-evm

Stack-based Ethereum VM implementation in Golang
Go
10
star
26

explorer-api

JavaScript
9
star
27

libconsensus-dag

Novel DAG consensus
Rust
9
star
28

fantom-finance

JavaScript
9
star
29

Fantom-Vue-Components

Library of various Vue 2 components with focus on accessibility.
JavaScript
9
star
30

fantom-documentation

Documentation on the Fantom Lachesis Consensus Algorithm
Makefile
9
star
31

fWallet-interface

TypeScript
8
star
32

example-deployment

JavaScript
8
star
33

Fantom-Uniswap

Uniswap protocol for exchanging ERC-20 tokens on Fantom Opera network.
Solidity
8
star
34

fantom-rust-vm

Register-based Ethereum VM implementation in Rust
Rust
7
star
35

explorer

JavaScript
7
star
36

fantom-govern

JavaScript
6
star
37

fns-ui

UI package for Fantom Naming Service
JavaScript
5
star
38

fantom-foundation-website

JavaScript
5
star
39

Substate

Go
5
star
40

artion-marketplace-tracker

JavaScript
5
star
41

bombarding-tool

Blockchain Bombarding Tool
C++
5
star
42

Fantom-FUni

Vue
5
star
43

go-txflow

aBFT txFlow consensus
Go
5
star
44

fantom-dev-web

Developer ecosystem website in Angular 8.3
HTML
5
star
45

Sonic

go-opera fork for Carmen and Tosca integration
Go
4
star
46

evm-rs

A new EVM implementation in Rust
Rust
4
star
47

fns-gui

JavaScript
4
star
48

web3_ftm_examples

Example directory for fantom web3 calls
JavaScript
4
star
49

web3-methods

JavaScript
4
star
50

fantom-ledger

Ledger Nano S and/or Ledger Nano X hardware wallet client for your Fantom account.
C
4
star
51

Fantom-Vue3-Components

Vue v.3 components for Fantom frontend UX.
JavaScript
4
star
52

Fantom-foundation.github.io

Developer ecosystem website generated from https://github.com/Fantom-foundation/fantom-dev-web
HTML
4
star
53

libconsensus

libconsensus
Rust
3
star
54

crypto-fantom-game

ERC721-based-game
JavaScript
3
star
55

Fantom-wFTM

Wrapped FTM ERC20 tokens implementation.
Solidity
3
star
56

substate-cli

Go
3
star
57

fantom-research

Research for Fantom's technology implementations
Makefile
3
star
58

bridge-snapshot

Repo for all economically active addresses within last 24 hours
3
star
59

Fantom-OnFire

Fantom application for presenting burned native FTM tokens.
JavaScript
3
star
60

jlachesis

A Java version of the Lachesis consensus protocol
Java
3
star
61

lachesis-rewards-api

Rewards api for explorer
JavaScript
3
star
62

qewa

Solidity
3
star
63

solidity-rs

Solidity implementation in Rust
Rust
3
star
64

dag2dot-tool

The utility for export DAG of lachesis events in DOT form.
Go
3
star
65

desktop-wallet

Desktop wallet implementation using ElectronJS
JavaScript
2
star
66

Fantom-Statheros

Statheros is the next app in Fantom DeFi ecosystem using Frax protocol.
JavaScript
2
star
67

rosetta-fantom

Go
2
star
68

fantom-testnet-deployment-scripts

Bash scripts for deploying Fantom testnet.
Shell
2
star
69

go-ethereum-substate

Go
2
star
70

libconsensus-lachesis-rs

libconsensus-lachesis-rs
Rust
2
star
71

fusd-client

JavaScript
2
star
72

full-cli-rs

full-cli-rs
Rust
2
star
73

fantom-framework

Fantom: A scalable framework for asynchronous distributed systems
HTML
2
star
74

flend

Flend is a contract which main purpose is to extend SFC with special fusd logic and to provide simple token lock up mechanism
JavaScript
2
star
75

fantom-rs-architecture

Architecture of Fantom Foundation Rust projects
2
star
76

lachesis-dag-tool

Go
2
star
77

website

JavaScript
2
star
78

Fantom-Oracle-Pricefeed

Solidity smart contract implementing simplified price feeds oracle for Fantom Opera network.
Solidity
2
star
79

Fantom-Fusd

Fantom fUSD stable coin smart contract based on OpenZeppelin implementation of ERC20 EIP standard.
Solidity
2
star
80

fantom-lachesis

OPERA: Reasoning about continuous common knowledge in asynchronous distributed systems
TeX
2
star
81

gnosis_front

Gnosis safe react app
TypeScript
2
star
82

Fantom-FLend-AAVE-v2

Fantom fLend protocol, part of the Fantom DEFI ecosystem, based on AAVE v.2 source code.
TypeScript
2
star
83

Fantom-Oracle-Backend

High performance block chain watchdog for oracle contracts off-chain world interaction.
Go
1
star
84

go-lachesis-substate

Go
1
star
85

libtransport

libtransport
Rust
1
star
86

libsignature

Rust
1
star
87

fantom-trezor

1
star
88

diamondproxy-hardhat

JavaScript
1
star
89

libtransport-grpc

Rust
1
star
90

fantom-fluid-staking-doc

1
star
91

nft-contract-detector

JavaScript
1
star
92

oracle-contract

JavaScript
1
star
93

jopera

Java
1
star
94

fantom-docker

Docker & related scripts for automated repeatable deployments
Dockerfile
1
star
95

opera-jet-api-graphql

Go
1
star
96

Fantom-FLend

FLend part of the DeFi ecosystem.
Solidity
1
star
97

fantom-rfcs

Request for comments documentation
Makefile
1
star
98

FIPs

The Fantom Improvement Proposal Repository
1
star
99

safe-transaction-service

Python
1
star
100

diamondproxy-truffle

JavaScript
1
star