StarkNet client implementation.

juno

Starknet client implementation.

Go Reference Go Report Card Actions Status codecov

Building from source

Run the following command.

% make all

Executables

Command Description
juno The StarkNet full node client.

Configuration

juno uses a configuration file named juno.yaml that is located in the following places depending on the operating system.

  • macOS - $HOME/Library/Application Support/juno/.
  • Other Unix systems - $XDG_CONFIG_HOME/juno/ or $HOME/.config/juno/ if the $XDG_CONFIG_HOME variable is not set.
  • Windows - %AppData%/juno/.

It generally looks like the following and a default will be generated if one does not exist.

The following is an example on how it would look on a macOS system (replace $HOME with a full path to the home directory).

db_path: $HOME/Library/Application Support/juno
ethereum:
  enabled: true
  node: "ethereum_archive_node"
rpc:
  enabled: true
  port: 8080
starknet:
  enabled: true
  feeder_gateway: "https://alpha-mainnet.starknet.io"
Owner
Nethermind
Nethermind - full .NET Core Ethereum node for Windows, Linux, MacOS
Nethermind
Comments
  • Implement Pedersen

    Implement Pedersen

    uses NethermindEth/crypto-cpp

    Description

    Currently fails to link because crypto-cpp needs extra build steps

    Changes:

    Types of changes

    • New feature (non-breaking change which adds functionality)

    Testing

    Requires testing: Yes

    Did you write tests??: Yes

    Documentation

    If this requires a documentation update, did you add one? No

  • update pedersen

    update pedersen

    Description

    Pedersen Hash is used a lot in the hash calculations and sometimes, we can't predict the input number (whether the elements are > 2 or less than 2). For example, this in the class hash computation.

    The current solution is checking this before computing the Pedersen hash. But given the fact that we may have to do this multiple times, it's neater to check in the Pedersen Hash function

    Changes:

    • Change 1
    • Change 2

    Types of changes

    • Improve existing functionality

    Testing

    Requires testing: Yes

    Did you write tests??: Yes

  • State Trie

    State Trie

    Towards #433

    Depends on #436

    Description

    Implements the trie defined in https://docs.starknet.io/documentation/develop/State/starknet-state/

    Types of changes

    Leave only items that describe your changes, remove the rest. Remove this line too.

    • New feature (non-breaking change which adds functionality)

    Testing

    Requires testing: Yes

    Did you write tests??: Yes

  • Refactor

    Refactor

    Description

    This PR refactors the following:

    • Removes rest server
    • Removes juno cli

    Types of changes

    • Refactoring (no functional changes, no api changes)

    Testing

    Requires testing: No

    Documentation

    If this requires a documentation update, did you add one? Yes

  • Reduce overall testing time of juno through changes in REST tests

    Reduce overall testing time of juno through changes in REST tests

    Tests currently take a long time because the rest api tests which are meant to fail (within /pkg/rest/tests/rest_test.go) take a long time to timeout.

    This means that, while the rest of the test suite finishes in less than 10 seconds, all the Test(...)Fail take ~ 10s each, 13 times, incrementing this substantially and wasting time.

    It would be good to have 1 timeout test with the normal rate, and the other failing tests to have a much smaller timeout or use a different method to check for failure than to wait out the full 10s.

  • Split out mdbx so RPC client doesn't have to depend on it

    Split out mdbx so RPC client doesn't have to depend on it

    We're not using the server code, but are instead using Juno as a RPC client. The client package depends on some internal bits which then pull in mdbx which introduces additional build constraints: it currently only builds via clang (https://github.com/NethermindEth/juno/issues/152).

  • Health Check for Node

    Health Check for Node

    We should be able to provide a RPC endpoint, and API endpoint that basically knows when the node is running properly, the db connections are ok, and the feeder gateway is responding well.

  • Add cache

    Add cache

    Changes:

    • Add the internal/cache package with the Cache interface and the LRUCache implementation

    Types of changes

    What types of changes does your code introduce?

    • New feature (non-breaking change which adds functionality)

    Testing

    Requires testing

    • Yes

    In case you checked yes, did you write tests??

    • Yes
  • Speed up fail rest tests

    Speed up fail rest tests

    Resolves #256

    Changes:

    • Extracted the hardcoded retry mechanism implemented in the http Do function.
    • Allows the http client to take a retry mechanism as parameter which will then be used in the Do function.
    • Test time before this PR
    ok  	github.com/NethermindEth/juno/pkg/rest/tests	123.929s
    
    • Test time after this PR
    ok  	github.com/NethermindEth/juno/pkg/rest/tests	5.299s
    

    Types of changes

    What types of changes does your code introduce? Put an x in the boxes that apply

    • [ ] Bugfix (non-breaking change which fixes an issue)
    • [X] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] Documentation Update
    • [ ] Code style update (formatting, renaming)
    • [X] Refactoring (no functional changes, no api changes)
    • [ ] Build related changes
    • [ ] Other (please describe):

    Testing

    Requires testing

    • [X] Yes
    • [] No

    In case you checked yes, did you write tests??

    • [X] Yes
    • [ ] No
  • Use gnark-crypto for felt and Pedersen hash

    Use gnark-crypto for felt and Pedersen hash

    Towards #466

    Description

    Use gnark-crypto for the felt and Pedersen hash primitives.

    Changes:

    • Replace felt package with starkcurve/fp package
    • Reimplement pedersen hash with starkcurve package, resulting in 3x performance improvement

    Types of changes

    • Refactoring (no functional changes, no api changes)

    Testing

    Requires testing: No, only modifying existing tests in a few places (since Pedersen and PedersenArray functions no longer return errors in any situations).

    Documentation

    If this requires a documentation update, did you add one? Comments where appropriate.

  • Add health check endpoint

    Add health check endpoint

    Fixes | Closes | Resolves #324

    Description

    Is needed to check that the node is running without errors

    Changes:

    • Add health package to check that node is healthy
    • Add documentation for it

    Types of changes

    Leave only items that describe your changes, remove the rest. Remove this line too.

    • New feature (non-breaking change which adds functionality)

    Testing

    Requires testing: Yes

    Did you write tests??: No, only manual testing

    Documentation

    If this requires a documentation update, did you add one? Yes

  • Benchmark for different types of serializations

    Benchmark for different types of serializations

    Description

    Adding Marshalling and UnMarshalling functions for a few different types of serliazations. included benchmarking code

    Local benchmarking results for speed: image

    Local benchmarking results for size after encoding: image

  • Format felt package

    Format felt package

    Description

    Ran make format from the root project directory to properly format the felt package.

    Types of changes

    • Code style update (formatting, renaming)

    Testing

    Requires testing: No

  • feat: implement contract address

    feat: implement contract address

    Description

    Contract address computation is required to compute the deploy transaction hash. Hence, the implementation.

    Types of changes

    • New feature (non-breaking change which adds functionality)

    Testing

    Requires testing: Yes

    Did you write tests??: Yes

  • Transaction hash

    Transaction hash

    Fixes | Closes | Resolves #

    Description

    Added the transaction hash logic for all types of transactions supported on starknet.

    Changes:

    • Added declare transaction hash logic
    • Added deploy transaction hash logic
    • Added invoke transaction hash logic

    Types of changes

    • New feature (non-breaking change which adds functionality)

    Testing

    Requires testing: Yes

    Did you write tests??: Yes

    Documentation

    If this requires a documentation update, did you add one? No

  • Implement pedersen hash using gnark-crypto

    Implement pedersen hash using gnark-crypto

    See: https://github.com/ConsenSys/gnark-crypto/issues/273

    Towards #466

    Description

    See linked issues above.

    Changes:

    • Implement pedersen hash using gnark-crypto

    Types of changes

    • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • Refactoring (no functional changes, no api changes)

    Testing

    Requires testing: Yes

    Did you write tests??: Yes (modified tests where necessary)

  • Replace felt.Felt with fp.Element

    Replace felt.Felt with fp.Element

    Since we are replacing our own felt package with the stark-curve package from gnark-crypto, we can no longer deal with the feeder gateway's inconsistent hex string representations in the source code. To work around this, we implement a custom JSON unmarshaller using reflection.

    Otherwise, this is virtually a drop-in replacement.

    Towards #466

    Description

    See linked issue

    Changes:

    • Replace felt.Felt with imported fp.Element
    • Add custom unmarshaller (see description above)

    Types of changes

    • New feature (non-breaking change which adds functionality)
    • Refactoring (no functional changes, no api changes)

    Testing

    Requires testing: Yes

    Did you write tests??: Yes (modified tests where necessary)

    Documentation

    If this requires a documentation update, did you add one? Some comment modifications where appropriate.

A Commander for Go implementation of official Ethereum Client

Young A Commander for Go implementation of official Ethereum Client by zhong-my. Overview Young Dependencies Young stands on the shoulder of many grea

Oct 14, 2021
Terra client in golang with multiple protocol implementation (anchor, astroport, prism, ...)

Terra A terra client with some protocol partial implementations (anchor, prism, terraswap type routers, ...) To be able to compile, you need to add th

Apr 11, 2022
The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.

Fabric Smart Client The Fabric Smart Client (FSC, for short) is a new Fabric client-side component whose objective is twofold. FSC aims to simplify th

Dec 14, 2022
Go implementation of BLAKE2 (b) cryptographic hash function (optimized for 64-bit platforms).

Go implementation of BLAKE2b collision-resistant cryptographic hash function created by Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, an

Jul 11, 2022
An implementation of JOSE standards (JWE, JWS, JWT) in Go

Go JOSE Package jose aims to provide an implementation of the Javascript Object Signing and Encryption set of standards. This includes support for JSO

Jan 8, 2023
Go implementation of SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein.

SipHash (Go) Go implementation of SipHash-2-4, a fast short-input PRF created by Jean-Philippe Aumasson and Daniel J. Bernstein (http://131002.net/sip

Dec 25, 2022
A simplified blockchain implementation in Golang

A simplified blockchain implementation in Golang

Dec 31, 2022
A full node Bitcoin (BSV) implementation written in Go

bsvd bsvd is a full node Bitcoin (BSV) implementation written in Go (golang). This project is a port of the bchd codebase to Bitcoin (BSV). It provide

Dec 25, 2022
Merchant API reference implementation

mAPI More details available in the BRFC Spec for Merchant API. The old golang (v1.1) implementation is no longer being maintained and has been moved t

Dec 14, 2022
`age-plugin-yubikey` implementation, encrypt things with a Yubikey/any PIV card

This is an age plugin for PIV cards/Yubikey. Your secret is kept safe on the tamperproof hardware, while letting you use the age command-line.

Aug 10, 2022
Interblockchain communication protocol (IBC) implementation in Golang.

ibc-go Interblockchain communication protocol (IBC) implementation in Golang built as a SDK module. Components Core The core/ directory contains the S

Jan 7, 2023
Implementation of the Filecoin protocol, written in Go
Implementation of the Filecoin protocol, written in Go

Project Lotus - 莲 Lotus is an implementation of the Filecoin Distributed Storage Network. For more details about Filecoin, check out the Filecoin Spec

Jan 9, 2023
Go implementation of Ethereum proof of stake

Prysm: An Ethereum Consensus Implementation Written in Go This is the core repository for Prysm, a Golang implementation of the Ethereum Consensus spe

Jan 1, 2023
Pure Go implementation of the NaCL set of API's

go-nacl This is a pure Go implementation of the API's available in NaCL: https://nacl.cr.yp.to. Compared with the implementation in golang.org/x/crypt

Dec 16, 2022
Go implementation of the Data At Rest Encryption (DARE) format.

Secure IO Go implementation of the Data At Rest Encryption (DARE) format. Introduction It is a common problem to store data securely - especially on u

Dec 18, 2022
Celer cBridge relay node implementation in Golang

cBridge Relay Node Official implementation of cBridge relay node in Golang. Prerequisites Prepare Machine To run a cBridge relay node, it is recommend

Sep 27, 2022
A simple implementation of SHA-256 Algorith in Go Language

SHA-256 in Go This is not a serious/efficient implementation of SHA-256 in Go. You can use the official package for that. This is just for learning pu

Sep 22, 2022
Go Implementation of the Spacemesh protocol full node. 💾⏰💪
Go Implementation of the Spacemesh protocol full node. 💾⏰💪

A Programmable Cryptocurrency go-spacemesh ?? ⏰ ?? Thanks for your interest in this open source project. This repo is the go implementation of the Spa

Dec 29, 2022
An implementation of the Filecoin Distributed Storage Network
An implementation of the Filecoin Distributed Storage Network

Project Lotus - 莲 Lotus is an implementation of the Filecoin Distributed Storage Network. For more details about Filecoin, check out the Filecoin Spec

Oct 27, 2021