summaryrefslogtreecommitdiffhomepage
path: root/BUILD.md
blob: 37be4b180851e4e3bb246756b99b9834f2fb90ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Development Guide

## Building the development environment

You need a working [Go environment](https://golang.org/doc/install) (1.11 or newer).

```bash
$ go get -u github.com/golang/dep/cmd/dep
$ go get github.com/osrg/gobgp
$ cd $GOPATH/src/github.com/osrg/gobgp && dep ensure
```

Now ready to modify the code and build two binaries, `cmd/gobgp` and `cmd/gobgpd`.

## Layout

The GoBGP project adopts [Standard Go Project Layout](https://github.com/golang-standards/project-layout).

## Changing the gRPC API

If you change the gRPC API, generate `api/gobgp.pb.go` in the following way:

```bash
$ protoc -I ~/protobuf/src -I ${GOBGP}/api --go_out=plugins=grpc:${GOBGP}/api \
         ${GOBGP}/api/gobgp.proto ${GOBGP}/api/attribute.proto ${GOBGP}/api/capability.proto
```