Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
/cli-conf/data-testnet/
/cli-conf/result-mainnet.json
/cli-conf/result-testnet.json
/data/
/.idea
/server
/script/node_modules/

integration/flow.json
integration/accounts.json
integration/emulator-account.pkey
integration/__pycache__/
23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@

all: build

relic:
./environ/build-relic.py

go-build:
go build -tags relic -o server cmd/server/server.go
go build -o server cmd/server/server.go

build: relic go-build
build: go-build

deps:
go mod download -x

lint:
@go mod tidy
@staticcheck -tags relic ./...

proto:
@echo ">> Generating model/model.pb.go"
@protoc --proto_path=model --go_out=model \
--go_opt=paths=source_relative model/model.proto

integration-test-cleanup:
rm -f flow.json
rm -f account-keys.csv
rm -rf data
rm -rf flow-go
rm -f integration/flow.json
rm -f integration/emulator-account.pkey
rm -f integration/accounts.json
rm -rf data/
rm -rf flow-go/

integration-test:
python3 integration_test.py
python3 integration_test.py


.PHONY clean:
rm -f ./server
29 changes: 18 additions & 11 deletions access/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ import (
"crypto/x509"
"encoding/hex"
"fmt"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"math/rand"
"strconv"
"strings"
"time"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"

grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
"github.com/onflow/cadence"
jsoncdc "github.com/onflow/cadence/encoding/json"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/flow-go/crypto"
"github.com/onflow/crypto"
"github.com/onflow/flow-go/network/p2p/keyutils"
"github.com/onflow/flow/protobuf/go/flow/access"
"github.com/onflow/flow/protobuf/go/flow/entities"
Expand Down Expand Up @@ -165,8 +166,9 @@ func (c Client) BlockEvents(ctx context.Context, blockID []byte, typ string) ([]
resp, err := c.client.GetEventsForBlockIDs(
ctx,
&access.GetEventsForBlockIDsRequest{
BlockIds: [][]byte{blockID},
Type: typ,
BlockIds: [][]byte{blockID},
Type: typ,
EventEncodingVersion: entities.EventEncodingVersion_CCF_V0,
},
)
cancel()
Expand Down Expand Up @@ -386,7 +388,8 @@ func (c Client) Transaction(ctx context.Context, hash []byte) (*entities.Transac
resp, err := c.client.GetTransaction(
ctx,
&access.GetTransactionRequest{
Id: hash,
Id: hash,
EventEncodingVersion: entities.EventEncodingVersion_CCF_V0,
},
)
cancel()
Expand All @@ -406,8 +409,9 @@ func (c Client) TransactionResult(ctx context.Context, blockID []byte, txnIndex
resp, err := c.client.GetTransactionResultByIndex(
ctx,
&access.GetTransactionByIndexRequest{
BlockId: blockID,
Index: txnIndex,
BlockId: blockID,
Index: txnIndex,
EventEncodingVersion: entities.EventEncodingVersion_CCF_V0,
},
)
cancel()
Expand All @@ -428,7 +432,8 @@ func (c Client) TransactionResultByHash(ctx context.Context, hash []byte) (*acce
resp, err := c.client.GetTransactionResult(
ctx,
&access.GetTransactionRequest{
Id: hash,
Id: hash,
EventEncodingVersion: entities.EventEncodingVersion_CCF_V0,
},
)
cancel()
Expand All @@ -453,7 +458,8 @@ func (c Client) TransactionResultsByBlockID(ctx context.Context, blockID []byte)
resp, err := c.client.GetTransactionResultsByBlockID(
ctx,
&access.GetTransactionsByBlockIDRequest{
BlockId: blockID,
BlockId: blockID,
EventEncodingVersion: entities.EventEncodingVersion_CCF_V0,
},
)
cancel()
Expand All @@ -473,7 +479,8 @@ func (c Client) TransactionsByBlockID(ctx context.Context, blockID []byte) ([]*e
resp, err := c.client.GetTransactionsByBlockID(
ctx,
&access.GetTransactionsByBlockIDRequest{
BlockId: blockID,
BlockId: blockID,
EventEncodingVersion: entities.EventEncodingVersion_CCF_V0,
},
)
cancel()
Expand Down
1 change: 0 additions & 1 deletion cmd/corecontracts/corecontracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func main() {
for _, network := range []flow.ChainID{
flow.Mainnet,
flow.Testnet,
flow.Canary,
flow.Localnet,
flow.Emulator,
} {
Expand Down
6 changes: 3 additions & 3 deletions cmd/genkey/genkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
)

func main() {
priv, err := secp256k1.GeneratePrivateKey()
privateKey, err := secp256k1.GeneratePrivateKey()
if err != nil {
log.Fatalf("Failed to generate key: %s", err)
}
pub := priv.PubKey()
pub := privateKey.PubKey()
fmt.Printf("Public Key (Flow Format): %x\n", pub.SerializeUncompressed()[1:])
fmt.Printf("Public Key (Rosetta Format): %x\n", pub.SerializeCompressed())
fmt.Printf("Private Key: %x\n", priv.Serialize())
fmt.Printf("Private Key: %x\n", privateKey.Serialize())
}
14 changes: 0 additions & 14 deletions environ/build-relic.py

This file was deleted.

Loading